package com.hombio.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hombio.UIBean.Take;
import com.hombio.service.MedicineMSService;

@Controller
public class MedicineTakeController {
	
	@Autowired
	MedicineMSService medicineMSService;
	
	@RequestMapping("/mt/storage/check")
	@ResponseBody
	public Take isStorage(String caseTraceCode){
		return medicineMSService.isStorage(caseTraceCode);
		
	}
	
	@RequestMapping("/mt/putaway/check")
	@ResponseBody
	public Take isPutaway(String boxTraceCode){
		return medicineMSService.isPutaway(boxTraceCode);
	}
	
	@RequestMapping("/mt/saveRecords/{managerId}/{takerId}/{taskId}")
	@ResponseBody
	public void saveTakeRecords(@PathVariable Integer managerId, @PathVariable Integer takerId,@PathVariable Integer taskId, @RequestBody Take[] records){
		medicineMSService.saveTakeRecords(managerId, takerId, taskId, records);
	}

}
